package org.tinygroup.channel.protocol.config;

import java.util.ArrayList;
import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("protocol-config")
public class ProtocolConfig {
	public final static String TYPE_IN = "in";
	public final static String TYPE_OUT = "out";
	@XStreamAsAttribute
	private String id;
	@XStreamAsAttribute
	private String bean;
	@XStreamAsAttribute
	private String type;
	@XStreamImplicit
	private List<ParamConfig> params;
	@XStreamImplicit
	private List<ProtocolListenerConfig> listeners;
	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getBean() {
		return bean;
	}
	public void setBean(String bean) {
		this.bean = bean;
	}
	public List<ParamConfig> getParams() {
		if(params==null){
			params = new ArrayList<ParamConfig>();
		}
		return params;
	}
	public void setParams(List<ParamConfig> params) {
		this.params = params;
	}
	public List<ProtocolListenerConfig> getListeners() {
		if(listeners==null){
			listeners = new ArrayList<ProtocolListenerConfig>();
		}
		return listeners;
	}
	public void setListeners(List<ProtocolListenerConfig> listeners) {
		this.listeners = listeners;
	}
	
}
